<template>
    <!-- 银保通历史状态查询-对比信息列表 -->
    <div class="fillcontain">
        <el-dialog
                title="对比信息列表"
                :visible.sync="drawer"
                :direction="direction"
                :width="'70%'"
                :before-close="handleClose"
                center
                >
            <div class="contain">
                <!-- 查询结果列表 -->
                <div class="table_container">
                    <el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark"
                              highlight-current-row header-cell-class-name="table-header-class"
                              style="width:100%">
                        <el-table-column property="SDESC" label="字段中文描述" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="SMODVALUE" label="外包录入值" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="SSRCVALUE" label="对应系统的值" align='center' show-overflow-tooltip min-width="120"></el-table-column>
                        <el-table-column property="FLAG01" label="关键字段" align='center' show-overflow-tooltip min-width="120" :formatter="changStatus1"></el-table-column>
                        <el-table-column property="FLAG02" label="是否更新" align='center' show-overflow-tooltip min-width="120" :formatter="changStatus2"></el-table-column>
                    </el-table>
                </div>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    import {mapGetters} from 'vuex'
    import constant from '@/utils/constant';
	import TaskConstants,{call} from "@/api/taskManager/common"
    export default {
        name: "bank-contrast-result",
        data() {
            return {
                // 查询条件
                direction: 'rtl',
                tableData: [],
                loading: false,
                nodeMap: {},//节点对象
                pickerOptions1: {
                    disabledDate(time) {
                        return time.getTime() > Date.now();
                    }
                }
            }
        },
        created() {
        },
        props: {
            drawer: {
                type: Boolean,
                default: false
            },
            taskNo: {
                type: String
            },
        },
        methods: {
			changStatus1(row) {
				if (row.FLAG01 == '1') {
					return "是";
				} else {
					return "否";
				}
			},
			changStatus2(row) {
				if (row.FLAG02 == '1') {
					return "是";
				} 
				if(row.FLAG02 =='2'){
					return "否（有保全变更）";
				}
				return "否";
			},
            handleClose(done) {
                this.$emit('close', this.drawer);
            },
            // 综合查询列表
            getList(taskNo) {
                this.tableData = [];
                this.$store.dispatch('loading/CHANGE_LOADING', true)
                call(TaskConstants.apis['queryContrastResult']+taskNo).then(res => {
                    this.$store.dispatch('loading/CHANGE_LOADING', false)
                    if (res.resultCode == constant.SUCCESS && res.data) {
                        this.tableData = res.data;
                    }
                }).catch(err => {
                    this.$store.dispatch('loading/CHANGE_LOADING', false);
                })
            },
        },
        watch: {
            taskNo: function (newValue) {
                if (newValue != undefined && newValue != '')
                    this.getList(newValue);
            },
        },
        computed: {
            ...mapGetters(['tags']),
        },
        activated() {
            if (this.reload) {
                this.$store.dispatch('loading/CHNAGE_RELOAD', false)
                Object.assign(this.$data, this.$options.data());
            }
        }
    }
</script>

<style lang="less" scoped>
    .fillcontain {
        padding-bottom: 0;
    }

    .contain {
        background: #fff;
        padding: 10px;
        margin-bottom: 20px;
    }

    .pagination {
        padding: 10px 20px;
        text-align: right;
    }

    .operationIcon {
        // padding: 12px;
        border: 1px solid #e5e5e5;
        border-radius: 50%;
        width: 22px;
        height: 22px;
        display: inline-block;
        cursor: pointer;
        box-shadow: 0 0 3px #f9f9f9;

        .svg-icon {
            font-size: 14px;
            fill: #68a3fc;
        }
    }

    .search_container {
        padding: 20px 20px 0 20px;
        border-top: 1px solid #e1e1e1;
    }
</style>



